package com.ufida.ids.dao.impl;

import java.util.List;

import org.apache.log4j.Logger;
import org.springframework.stereotype.Repository;

import com.hereway.core.context.PageBean;
import com.hereway.core.dao.BaseHibernateDAO;
import com.ufida.ids.dao.IOrgDAO;
import com.ufida.ids.model.OrgModel;

@Repository("orgDAO")
public class OrgDAOImpl extends BaseHibernateDAO<OrgModel, Long> implements IOrgDAO {
	@Override
	public List<OrgModel> findByParentId(Long parentId) {
		return super.find("where parentOrgId = " + parentId);
	}
	
	public int findCountByCon(String whereStr) {
		return super.find(whereStr).size();
	}

	@Override
	protected String getDefaultOrderStr() {
		return "order by showOrder,orgId";
	}
}
